home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_04
/
8n04031a
< prev
next >
Wrap
Text File
|
1990-03-18
|
576b
|
29 lines
*****Listing 3*****
#include <math.h> /* get struct */
int matherr(struct exception *pe)
{
int retval = 1; /* assume we'll recover */
printf("Function %s failed with error type ", pe->name);
if (pe->type == DOMAIN)
printf("DOMAIN\n");
else if (pe->type == SING)
printf("SING\n");
else if (pe->type == OVERFLOW)
printf("OVERFLOW\n");
else if (pe->type == UNDERFLOW)
printf("UNDERFLOW\n");
else if (pe->type == TLOSS)
printf("TLOSS\n");
else {
printf("UNKNOWN\n");
retval = 0; /* can't handle here */
}
return retval;
}